//
//  AppearanceSettingsModule.m
//  Cantrip
//
//  Created by James Callender on Tue Jun 08 2004.
//  Copyright (c) 2004 James Callender. All rights reserved.
//

#import "AppearanceSettingsModule.h"


@implementation AppearanceSettingsModule

- (id)init
{
    if (self = [super init])
    {
        [NSBundle loadNibNamed:@"AppearanceSettingsView" owner:self];
    }
    
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)awakeFromNib
{
    
}

- (NSString *)settingsDisplayName
{
    return @"Appearance";
}

- (NSImage *)settingsDisplayIcon
{
    return [NSImage imageNamed:@"AppearanceIcon.tiff"];
}

- (NSView *)settingsView
{
    return oSettingsView;
}

- (NSArray *)fonts
{
    return [[[NSFontManager sharedFontManager] availableFonts] 
	sortedArrayUsingSelector:@selector(compare:)];
}

- (NSSize)size
{
    return NSMakeSize(526, 354);
}

- (id)world
{
    return currentWorld;
}

- (void)updateForWorld:(id)world
{
    if (world != currentWorld) {
	[self willChangeValueForKey:@"world"];
	currentWorld = world;
	[self didChangeValueForKey:@"world"];
    }
    
}

- (NSDictionary *)defaultWorldProperties
{
    NSArray *ansiKeys = [NSArray arrayWithObjects:
	@"red", @"blue", @"green", @"yellow", @"cyan", @"magenta", @"black", @"white", nil];
    
    return [NSDictionary dictionaryWithObjectsAndKeys:
	[NSColor whiteColor], @"displayForegroundColor",
	[NSColor blackColor], @"displayBackgroundColor",
	[NSColor blackColor], @"inputForegroundColor",
	[NSColor whiteColor], @"inputBackgroundColor",
	[NSColor redColor], @"messagesColor",
	[NSColor blueColor], @"echoColor",
	[NSMutableDictionary dictionaryWithObjects:
	    [NSArray arrayWithObjects:
		[NSColor redColor], [NSColor blueColor], [NSColor greenColor], [NSColor yellowColor],
		[NSColor cyanColor], [NSColor magentaColor], [NSColor darkGrayColor], [NSColor lightGrayColor], nil]
				    forKeys:ansiKeys], @"standardANSIColors",
	[NSMutableDictionary dictionaryWithObjects:
	    [NSArray arrayWithObjects:
		[NSColor redColor], [NSColor blueColor], [NSColor greenColor], [NSColor yellowColor],
		[NSColor cyanColor], [NSColor magentaColor], [NSColor darkGrayColor], [NSColor lightGrayColor], nil]
				    forKeys:ansiKeys], @"intenseANSIColors",
	[NSNumber numberWithInt:24], @"displayRows",
	[NSNumber numberWithInt:90], @"displayColumns",
	[NSNumber numberWithInt:5], @"tabSize",
	[NSNumber numberWithInt:1000], @"scrollback",
	[NSNumber numberWithBool:YES], @"enableANSIColors",
	[NSNumber numberWithInt:YES], @"enableIntenseColors",
	[NSNumber numberWithInt:NO], @"emboldenIntenseColors",
	[NSNumber numberWithInt:YES], @"enableTextBlinking",
	@"Courier", @"fontName",
	[NSNumber numberWithInt:12], @"fontSize",
	[[NSFont systemFontOfSize:13] fontName], @"inputFontName",
	[NSNumber numberWithInt:13], @"inputFontSize",
    	nil];
}

@end
